<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="TVerifyCodeInf">

	<typeAlias alias="TVerifyCodeInf" type="com.umpay.wireless.dao.po.TVerifyCodeInf" />

	<sql id="select_what">
		select rtrim(BUSITRACE) as busiTrace,rtrim(BUSITYPE) as busiType,rtrim(MOBILEID) as mobileId,
		rtrim(VERIFYCODE) as verifyCode,INVALIDTIME,SMSCOUNT,ERRORCOUNT,
		INTIME,MODTIME from umpay.$tableName$
	</sql>

	<sql id="key_map">
		where BUSITRACE=#busiTrace# and BUSITYPE=#busiType#
	</sql>

	<!-- update and insert -->
	<sql id="Insert_column">
		<dynamic >
			<isNotEmpty property="mobileId" prepend=" , ">
				mobileId
			</isNotEmpty>
			<isNotEmpty property="verifyCode" prepend=" , ">
				verifyCode
			</isNotEmpty>
			<isNotEmpty property="invalidTime" prepend=" , ">
				invalidTime
			</isNotEmpty>
			<isNotEmpty property="smsCount" prepend=" , ">
				smsCount
			</isNotEmpty>
			<isNotEmpty property="errorCount" prepend=" , ">
				errorCount
			</isNotEmpty>
			<isNotEmpty property="inTime" prepend=" , ">
				inTime
			</isNotEmpty>
			<isNotEmpty property="modTime" prepend=" , ">
				modTime
			</isNotEmpty>
		</dynamic>
	</sql>

	<sql id="Insert_value">
		<dynamic >
			<isNotEmpty property="mobileId" prepend=" , ">
				#mobileId#
			</isNotEmpty>
			<isNotEmpty property="verifyCode" prepend=" , ">
				#verifyCode#
			</isNotEmpty>
			<isNotEmpty property="invalidTime" prepend=" , ">
				#invalidTime#
			</isNotEmpty>
			<isNotEmpty property="smsCount" prepend=" , ">
				#smsCount#
			</isNotEmpty>
			<isNotEmpty property="errorCount" prepend=" , ">
				#errorCount#
			</isNotEmpty>
			<isNotEmpty property="inTime" prepend=" , ">
				#inTime#
			</isNotEmpty>
			<isNotEmpty property="modTime" prepend=" , ">
				#modTime#
			</isNotEmpty>

		</dynamic>
	</sql>

	<select id="selectCurrentTimeOfDb" resultClass="java.sql.Timestamp" >
		SELECT current timestamp FROM sysibm.sysdummy1
	</select>

	<statement id="selectByPrimaryKey" resultClass="TVerifyCodeInf">
		<include refid="select_what" />
		<include refid="key_map" />
	</statement>

	<insert id="Insert">
		insert into umpay.$tableName$(busiTrace,busiType
		<include refid="Insert_column" />
		)
		values (#busiTrace#,#busiType#
		<include refid="Insert_value" />
		)
	</insert>

	<update id="Update">
		update umpay.$tableName$
		<dynamic prepend="set">
			<isNotEmpty property="mobileId" prepend=" , ">
				mobileId=#mobileId#
			</isNotEmpty>
			<isNotEmpty property="verifyCode" prepend=" , ">
				verifyCode=#verifyCode#
			</isNotEmpty>
			<isNotEmpty property="invalidTime" prepend=" , ">
				invalidTime=#invalidTime#
			</isNotEmpty>
			<isNotEmpty property="smsCount" prepend=" , ">
				smsCount=#smsCount#
			</isNotEmpty>
			<isNotEmpty property="errorCount" prepend=" , ">
				errorCount=#errorCount#
			</isNotEmpty>
			<isNotEmpty property="modTime" prepend=" , ">
				modTime=#modTime#
			</isNotEmpty>

		</dynamic>
		<include refid="key_map" />
	</update>

</sqlMap>